package com.powernode.proxy.util;

import com.powernode.proxy.service.OrderService;
import com.powernode.proxy.service.TimerInvocationHandler;

import java.lang.reflect.Proxy;

public class ProxyUtil {
    public static Object newProxyInstance(Object target){
        OrderService proxyObj = (OrderService) Proxy.newProxyInstance(target.getClass().
                getClassLoader(), target.getClass().getInterfaces(),new TimerInvocationHandler(target));
        return proxyObj;
    }
}
